package com.exercise;

import com.sun.org.apache.bcel.internal.generic.SWAP;

import java.util.Arrays;

/**
 * @author 王林
 * @version 1.0
 * @date 2021-09-16 周四
 * @time 22:12
 * @description
 */
public class Test01 {
    public static void main(String[] args) {

        int[] arry = {1, 4, 5, 6, 7, 2, 3, 0};

        for (int i = 0; i < arry.length; i++) {
            int minIndex = 0;
            for (int j = i + 1; j < arry.length; j++) {
                minIndex = arry[j] < arry[minIndex] ? j : minIndex;
                int temp = arry[j];
                arry[j] = arry[minIndex];
                arry[minIndex] = temp;

            }
        }
        System.out.println(Arrays.toString(arry));
//        System.out.println();
    }
}
